<template>
    <div class="test">
        <div class="audit">
            <el-form :rules="rules" ref="dataForm" :model="temp" :key='tableKey' :data="list" class="el_form">
                <div class="jy" style="font-size: 20px">经营信息</div>
                <el-form-item label="主要经营类目" prop="manageType">
                     <div style="color: white">&nbsp;</div>
                    <el-cascader
                            collapse-tags
                            v-model="fenLeiTypes"
                            :options="mallTypes"
                            :props="props"
                            @change="handleChange"
                            clearable>
                    </el-cascader>
                </el-form-item>
                <el-form-item label="品牌名称" prop="brandName">
                    <el-input v-model="temp.brandName" placeholder="请填写品牌名称"></el-input>
                </el-form-item>
                <el-form-item label="品牌简介" prop="brandInfo">
                    <el-input v-model="temp.brandInfo" placeholder="请填写品牌简介"></el-input>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1|| this.bigTypes.indexOf(48) > -1|| this.bigTypes.indexOf(415) > -1" label="生产企业卫生许可证" prop="companyhealthLicense">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companyhealthLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanyhealthLicenseUploadSuccess"
                            :data="qData"
                            :file-list="companyhealthLicenseList"
                            :on-remove="handlecompanyhealthLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(61) > -1|| this.bigTypes.indexOf(46) > -1|| this.bigTypes.indexOf(55) > -1|| this.bigTypes.indexOf(415) > -1" label="生产许可证" prop="produceLicense">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="produceLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleproduceLicenseUploadSuccess"
                            :data="qData"
                            :file-list="produceLicenseList"
                            :on-remove="handleproduceLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(61) > -1|| this.bigTypes.indexOf(46) > -1|| this.bigTypes.indexOf(55) > -1|| this.bigTypes.indexOf(415) > -1" label="经营许可证" prop="manageLicense">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="manageLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlemanageLicenseUploadSuccess"
                            :data="qData"
                            :file-list="manageLicenseList"
                            :on-remove="handlemanageLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(47) > -1||this.bigTypes.indexOf(42) > -1||this.bigTypes.indexOf(46) > -1||this.bigTypes.indexOf(55) > -1" label="备案登记" prop="manageLicense">
                    <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="recordTableUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlerecordTableUploadSuccess"
                            :data="qData"
                            :file-list="recordTableList"
                            :on-remove="handlerecordTableRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.length > 0" label="销售授权书" prop="manageLicense">
                    <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="salesAuthorizationUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlesalesAuthorizationUploadSuccess"
                            :data="qData"
                            :file-list="salesAuthorizationList"
                            :on-remove="handlesalesAuthorizationRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(61) > -1||this.bigTypes.indexOf(415) > -1" label="产品加工协议" prop="manageLicense">
                    <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="productAgreementUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleproductAgreementUploadSuccess"
                            :data="qData"
                            :file-list="productAgreementList"
                            :on-remove="handleproductAgreementRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>

                <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="保健食品GMP证书" prop="gmpLicense">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="gmpLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlegmpLicenseUploadSuccess"
                            :data="qData"
                            :file-list="gmpLicenseList"
                            :on-remove="handlegmpLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.length > 0" label="商标注册证">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="trademarkLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handletrademarkLicenseUploadSuccess"
                            :data="qData"
                            :file-list="trademarkLicenseList"
                            :on-remove="handletrademarkLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if=" this.bigTypes.indexOf(54) > -1 || this.bigTypes.indexOf(44) > -1|| this.bigTypes.indexOf(48) > -1|| this.bigTypes.indexOf(58) > -1|| this.bigTypes.indexOf(42) > -1|| this.bigTypes.indexOf(46) > -1
|| this.bigTypes.indexOf(52) > -1|| this.bigTypes.indexOf(53) > -1|| this.bigTypes.indexOf(57) > -1" label="成品检测报告（由国家认定的具有CNAS与CMA资质的第三方质检机构出具的检测报告）">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="goodsProveUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlegoodsProveUploadSuccess"
                            :data="qData"
                            :file-list="goodsProveList"
                            :on-remove="handlegoodsProveRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if=" this.bigTypes.indexOf(41) > -1" label="非特殊用途化妆品备案">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="recordTableUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlerecordTableUploadSuccess"
                            :data="qData"
                            :file-list="recordTableList"
                            :on-remove="handlerecordTableRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(47) > -1|| this.bigTypes.indexOf(415) > -1" label="商品质量保证书">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="qualityGuarantyUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlequalityGuarantyUploadSuccess"
                            :data="qData"
                            :file-list="qualityGuarantyList"
                            :on-remove="handlequalityGuarantyRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if=" this.bigTypes.indexOf(54) > -1 || this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1" label="完整的销售授权">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="salesAuthorizationUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlesalesAuthorizationUploadSuccess"
                            :data="qData"
                            :file-list="salesAuthorizationList"
                            :on-remove="handlesalesAuthorizationRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if=" this.bigTypes.length > 0" label="进口货物报关单复印件（若经营进口商品，需提交该品牌中华人民共和国）">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="goodsDeclarationUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlegoodsDeclarationUploadSuccess"
                            :data="qData"
                            :file-list="goodsDeclarationList"
                            :on-remove="handlegoodsDeclarationRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(41) > -1||this.bigTypes.indexOf(55) > -1" label="入境货物检验检疫证明（若经营进口商品，需提交该品牌中华人民共和国）">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="testProveUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handletestProveUploadSuccess"
                            :data="qData"
                            :file-list="testProveList"
                            :on-remove="handletestProveRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(44) > -1" label="产品加工协议">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="productAgreementUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleproductAgreementUploadSuccess"
                            :data="qData"
                            :file-list="productAgreementList"
                            :on-remove="handleproductAgreementRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(61) > -1  || this.bigTypes.indexOf(415) > -1" label="食品流通许可证">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="circulateLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecirculateLicenseUploadSuccess"
                            :data="qData"
                            :file-list="circulateLicenseList"
                            :on-remove="handlecirculateLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(47) > -1|| this.bigTypes.indexOf(415) > -1" label="产品检测报告复印件">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="detectPhotocopyUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handledetectPhotocopyUploadSuccess"
                            :data="qData"
                            :file-list="detectPhotocopyList"
                            :on-remove="handledetectPhotocopyRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(60) > -1|| this.bigTypes.indexOf(55) > -1" label="产品清单(若经营进口货物需提供,产品清单需与报关单产品保持一致性)">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="productListUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleproductListUploadSuccess"
                            :data="qData"
                            :file-list="productListList"
                            :on-remove="handleproductListRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="进口保健食品批准证书(若经营进口货物需提供)">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="approveLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleapproveLicenseUploadSuccess"
                            :data="qData"
                            :file-list="approveLicenseList"
                            :on-remove="handleapproveLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1||this.bigTypes.indexOf(46) > -1||this.bigTypes.indexOf(55) > -1" label="委托加工协议">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="entrustAgreementUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleentrustAgreementUploadSuccess"
                            :data="qData"
                            :file-list="entrustAgreementList"
                            :on-remove="handleentrustAgreementRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(41) > -1" label="化妆品生产企业卫生许可证">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companyhealthLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanyhealthLicenseUploadSuccess"
                            :data="qData"
                            :file-list="companyhealthLicenseList"
                            :on-remove="handlecompanyhealthLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(41) > -1 ||this.bigTypes.indexOf(58) > -1||this.bigTypes.indexOf(42) > -1||this.bigTypes.indexOf(55) > -1" label="全国工业生产许可证">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="industryLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleindustryLicenseUploadSuccess"
                            :data="qData"
                            :file-list="industryLicenseList"
                            :on-remove="handleindustryLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item><!--
                <el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="国产花露水、驱虫产品、蚊香、杀蟑胶饵产品需提供农药产品生产许可证或全国工业生产许可证（农药产品和农药登记证（或者农药临时登记证）、生产单位营业执照">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
             <!--   <el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="国产餐具洗涤剂、清洁剂、保鲜膜等需提供全国工业生产许可证、生产商营业执照">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="首次进口的消毒剂和消毒器械产品须提供针对具体产品型号的《卫生许可批件》">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
               <!-- <el-form-item v-if="this.bigTypes.indexOf(45) > -1 && this.bigTypes.indexOf(124) > -1" label="全国工业产品生产许可证或者牙膏生产企业卫生许可证、生产单位营业执照">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->

                <!--<el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="具有抑菌、抗菌、杀菌功能的洗手液、消毒液(剂)等（消毒产品生产企业卫生许可证、生产单位营业执照）">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
                <el-form-item v-if="this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(44) > -1|| this.bigTypes.indexOf(48) > -1|| this.bigTypes.indexOf(58) > -1|| this.bigTypes.indexOf(42) > -1|| this.bigTypes.indexOf(55) > -1|| this.bigTypes.indexOf(43) > -1" label="CCC认证证书">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="cccLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecccLicenseUploadSuccess"
                            :data="qData"
                            :file-list="cccLicenseList"
                            :on-remove="handlecccLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(61) > -1" label="动物防疫条件合格证、动物检验检疫证明">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="epidemicPreventionUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleepidemicPreventionUploadSuccess"
                            :data="qData"
                            :file-list="epidemicPreventionList"
                            :on-remove="handleepidemicPreventionRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(61) > -1" label="农产品卫生检疫合格证明">
                    <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="epidemicPreventionUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handleepidemicPreventionUploadSuccess"
                            :data="qData"
                            :file-list="epidemicPreventionList"
                            :on-remove="handleepidemicPreventionRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(61) > -1 || this.bigTypes.indexOf(60) > -1" label="产品检测报告">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="detectPhotocopyUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handledetectPhotocopyUploadSuccess"
                            :data="qData"
                            :file-list="detectPhotocopyList"
                            :on-remove="handledetectPhotocopyRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
             <!--   <el-form-item v-if="this.bigTypes.indexOf(61) > -1 || this.bigTypes.indexOf(60) > -1" label="食品流通许可证或食品经营许可证">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1" label="品牌商的食品经营企业卫生许可证">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="managehealthLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlemanagehealthLicenseUploadSuccess"
                            :data="qData"
                            :file-list="managehealthLicenseList"
                            :on-remove="handlemanagehealthLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="生产厂商的企业营业执照副本复印件(非生产厂商)">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companyLicenseUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanyLicenseUploadSuccess"
                            :data="qData"
                            :file-list="companyLicenseList"
                            :on-remove="handlecompanyLicenseRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
              <!--  <el-form-item v-if="this.bigTypes.indexOf(61) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(60) > -1" label="商标注册证复印件或商标注册受理通知书">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
          <!--      <el-form-item v-if="this.bigTypes.indexOf(41) > -1" label="进口非特化妆品备案">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
   <!--             <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="营业执照(应有生产经营保健品或预包装经营范围)">
                     <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
                <el-form-item label="品牌方承诺书或授权书">
                    <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="brandAuthorizationUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlebrandAuthorizationUploadSuccess"
                            :data="qData"
                            :file-list="brandAuthorizationList"
                            :on-remove="handlebrandAuthorizationRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item label="公司营业执照">
                    <div style="color: white">&nbsp;</div>
                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
            </el-form>
            <div  class="dialog-footer">
                <!-- <el-button @click="closeDialogForm">取消</el-button>-->
                <el-button class="btn" type="primary" round @click="turn()">下一步</el-button>
                <!-- <el-button v-else type="primary" @click="updateData">确认</el-button>-->
            </div>
        </div>

    </div>

</template>
<style>
    .audit {
        width: 800px;
        margin: 0 auto;
    }

    .lx {
        margin-top: 30px;
        font-weight: bold
    }

    .jy {
        margin-bottom: 10px;
        font-weight: bold
    }
    .dialog-footer {
        display: flex;
        justify-content: flex-end;
    }
    .btn {
        margin-bottom: 10px;

    }
</style>
<script>
    import {listType} from '@/api/mall_goods'
    import {getToken, domain} from '@/api/qiniu'
    import {listToStrs, strsToList} from '@/utils/imgUtil'

    export default {
        data() {
            return {
                brandbusinessLicenseList : [],
                companyhealthLicenseList : [],
                managehealthLicenseList : [],
                approveLicenseList : [],
                produceLicenseList : [],
                registerNoticeList : [],
                manageLicenseList : [],
                gmpLicenseList : [],
                trademarkLicenseList : [],
                productAgreementList : [],
                circulateLicenseList : [],
                betweencirculateLicenseList : [],
                detectPhotocopyList : [],
                goodsDeclarationList : [],
                productListList : [],
                companyLicenseList : [],
                entrustAgreementList : [],
                qualityGuarantyList : [],
                healthPhotocopyList : [],
                fiveTrademarkList : [],
                recordTableList : [],
                epidemicPreventionList : [],
                industryLicenseList : [],
                salesAuthorizationList : [],
                testProveList : [],
                cccLicenseList : [],
                goodsProveList : [],
                brandAuthorizationList : [],
                active: 1,
                fenLeiTypes: [],
                flTypes: [],
                mallTypes: [],
                bigTypes: [],
                companybusImgList: [],
                dialogImageUrl: '',
                dialogVisible: false,
                tableKey: 0,
                list: null,
                props: {multiple: true, label: "name", value: "id"},
                goodsTemp: {
                    id: null,
                    shopId: null,
                    businessLicense: null,
                    brandbusinessLicense: null,
                    companyhealthLicense: null,
                    managehealthLicense: null,
                    approveLicense: null,
                    produceLicense: null,
                    registerNotice: null,
                    manageLicense: null,
                    gmpLicense: null,
                    trademarkLicense: null,
                    productAgreement: null,
                    circulateLicense: null,
                    betweencirculateLicense: null,
                    detectPhotocopy: null,
                    goodsDeclaration: null,
                    productList: null,
                    companyLicense: null,
                    entrustAgreement: null,
                    qualityGuaranty: null,
                    healthPhotocopy: null,
                    fiveTrademark: null,
                    recordTable: null,
                    epidemicPrevention: null,
                    industryLicense: null,
                    salesAuthorization: null,
                    testProve: null,
                    cccLicense: null,
                    goodsProve: null,
                    brandAuthorization: null
                },
                qData: {
                    token: '',
                    key: ''
                },
                rules: {
                    brandName: [
                        {
                            required: true,
                            message: '必填字段',
                            trigger: 'change'
                        }],
                    brandInfo: [
                        {
                            required: true,
                            message: '必填字段',
                            trigger: 'change'
                        }]
                }
            }
        },
        created() {
            //获取所有的分类
            listType().then(res => {
                this.mallTypes = res.data
            })
            this.initQiniu()
        },
        methods: {
            handleChange(value) {
                this.flTypes = value;
                let fl = [];
                let bigTypes = [];
                this.flTypes.forEach(item => {
                    fl.push(item[1])
                    bigTypes.push(item[0])
                })
                this.flTypes = fl;
                this.bigTypes = bigTypes
            },
            turn() {
                this.$refs['dataForm'].validate((valid) => {
                    this.initImgName()
                    if (valid) {
                        if (this.flTypes == null || this.flTypes.length == 0) {
                            this.$alert('请选择主要经营类目', {
                                confirmButtonText: '确定',
                            })
                            return;
                        }
                        if (this.goodsTemp.brandAuthorization == null || this.goodsTemp.brandAuthorization == "") {
                            this.$alert('请上传品牌方承诺书或授权书', {
                                confirmButtonText: '确定',
                            })
                            return;
                        }
                        if (this.temp.companyBusImg == null || this.temp.companyBusImg == "") {
                            this.$alert('请上传公司营业执照', {
                                confirmButtonText: '确定',
                            })
                            return;
                        }


                        // 跳转路由传递对象参数
                        this.$router.push({name: 'shopAudit', params: {tshopType: this.flTypes,goodsTemp:this.goodsTemp}})
                    }
                })
            },
            // 显示将图片名封装成可以展示状态集合
            initImgUrl() {
                this.companybusImgList = strsToList(this.temp.companyBusImg, domain)
                console.log(this.companybusImgList)
            },
            // 上传或者更新的时候从图片链接中获取图片名字
            initImgName() {
                this.temp.companyBusImg = listToStrs(this.companybusImgList)
                this.goodsTemp.brandbusinessLicense = listToStrs(this.brandbusinessLicenseList)
                this.goodsTemp.companyhealthLicense = listToStrs(this.companyhealthLicenseList)
                this.goodsTemp.managehealthLicense = listToStrs(this.managehealthLicenseList)
                this.goodsTemp.approveLicense = listToStrs(this.approveLicenseList)
                this.goodsTemp.produceLicense = listToStrs(this.produceLicenseList)
                this.goodsTemp.registerNotice = listToStrs(this.registerNoticeList)
                this.goodsTemp.manageLicense = listToStrs(this.manageLicenseList)
                this.goodsTemp.gmpLicense = listToStrs(this.gmpLicenseList)
                this.goodsTemp.trademarkLicense = listToStrs(this.trademarkLicenseList)
                this.goodsTemp.productAgreement = listToStrs(this.productAgreementList)
                this.goodsTemp.circulateLicense = listToStrs(this.circulateLicenseList)
                this.goodsTemp.betweencirculateLicense = listToStrs(this.betweencirculateLicenseList)
                this.goodsTemp.detectPhotocopy = listToStrs(this.detectPhotocopyList)
                this.goodsTemp.goodsDeclaration = listToStrs(this.goodsDeclarationList)
                this.goodsTemp.productList = listToStrs(this.productListList)
                this.goodsTemp.companyLicense = listToStrs(this.companyLicenseList)
                this.goodsTemp.entrustAgreement = listToStrs(this.entrustAgreementList)
                this.goodsTemp.qualityGuaranty = listToStrs(this.qualityGuarantyList)
                this.goodsTemp.healthPhotocopy = listToStrs(this.healthPhotocopyList)
                this.goodsTemp.fiveTrademark = listToStrs(this.fiveTrademarkList)
                this.goodsTemp.recordTable = listToStrs(this.recordTableList)
                this.goodsTemp.epidemicPrevention = listToStrs(this.epidemicPreventionList)
                this.goodsTemp.industryLicense = listToStrs(this.industryLicenseList)
                this.goodsTemp.salesAuthorization = listToStrs(this.salesAuthorizationList)
                this.goodsTemp.testProve = listToStrs(this.testProveList)
                this.goodsTemp.cccLicense = listToStrs(this.cccLicenseList)
                this.goodsTemp.goodsProve = listToStrs(this.goodsProveList)
                this.goodsTemp.brandAuthorization = listToStrs(this.brandAuthorizationList)
            },
            initQiniu() {
                // 获取七牛配置
                getToken().then(res => {
                    this.qData.token = res.data
                }).catch(error => {
                    console.log(error)
                })
            },
            // 存在图片
            handleUpload(file) {
                this.qData.key = new Date().valueOf() + file.name
            },
            handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url
                this.dialogVisible = true
            },
            handlecompanybusImgUploadSuccess(response, file, fileList) {
                this.companybusImgList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecompanybusImgRemove(file, fileList) {
                for (var fn of this.companybusImgList) {
                    if (fn.name === file.name) {
                        this.companybusImgList.splice(this.companybusImgList.indexOf(fn), 1)
                    }
                }
            },

            handlecompanyhealthLicenseUploadSuccess(response, file, fileList) {
                this.companyhealthLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlemanagehealthLicenseUploadSuccess(response, file, fileList) {
                this.managehealthLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleapproveLicenseUploadSuccess(response, file, fileList) {
                this.approveLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleproduceLicenseUploadSuccess(response, file, fileList) {
                this.produceLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,

            handlemanageLicenseUploadSuccess(response, file, fileList) {
                this.manageLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlegmpLicenseUploadSuccess(response, file, fileList) {
                this.gmpLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handletrademarkLicenseUploadSuccess(response, file, fileList) {
                this.trademarkLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleproductAgreementUploadSuccess(response, file, fileList) {
                this.productAgreementList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecirculateLicenseUploadSuccess(response, file, fileList) {
                this.circulateLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handledetectPhotocopyUploadSuccess(response, file, fileList) {
                this.detectPhotocopyList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlegoodsDeclarationUploadSuccess(response, file, fileList) {
                this.goodsDeclarationList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleproductListUploadSuccess(response, file, fileList) {
                this.productListList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecompanyLicenseUploadSuccess(response, file, fileList) {
                this.companyLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleentrustAgreementUploadSuccess(response, file, fileList) {
                this.entrustAgreementList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlequalityGuarantyUploadSuccess(response, file, fileList) {
                this.qualityGuarantyList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlerecordTableUploadSuccess(response, file, fileList) {
                this.recordTableList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleepidemicPreventionUploadSuccess(response, file, fileList) {
                this.epidemicPreventionList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleindustryLicenseUploadSuccess(response, file, fileList) {
                this.industryLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlesalesAuthorizationUploadSuccess(response, file, fileList) {
                this.salesAuthorizationList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handletestProveUploadSuccess(response, file, fileList) {
                this.testProveList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecccLicenseUploadSuccess(response, file, fileList) {
                this.cccLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlegoodsProveUploadSuccess(response, file, fileList) {
                this.goodsProveList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlebrandAuthorizationUploadSuccess(response, file, fileList) {
                this.brandAuthorizationList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecompanyhealthLicenseRemove (file, fileList) {
                for (var fn of this.companyhealthLicenseList) {
                    if (fn.name === file.name) {
                        this.companyhealthLicenseList.splice(this.companyhealthLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlemanagehealthLicenseRemove (file, fileList) {
                for (var fn of this.managehealthLicenseList) {
                    if (fn.name === file.name) {
                        this.managehealthLicenseList.splice(this.managehealthLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleapproveLicenseRemove (file, fileList) {
                for (var fn of this.approveLicenseList) {
                    if (fn.name === file.name) {
                        this.approveLicenseList.splice(this.approveLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleproduceLicenseRemove (file, fileList) {
                for (var fn of this.produceLicenseList) {
                    if (fn.name === file.name) {
                        this.produceLicenseList.splice(this.produceLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlemanageLicenseRemove (file, fileList) {
                for (var fn of this.manageLicenseList) {
                    if (fn.name === file.name) {
                        this.manageLicenseList.splice(this.manageLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlegmpLicenseRemove (file, fileList) {
                for (var fn of this.gmpLicenseList) {
                    if (fn.name === file.name) {
                        this.gmpLicenseList.splice(this.gmpLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handletrademarkLicenseRemove (file, fileList) {
                for (var fn of this.trademarkLicenseList) {
                    if (fn.name === file.name) {
                        this.trademarkLicenseList.splice(this.trademarkLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleproductAgreementRemove (file, fileList) {
                for (var fn of this.productAgreementList) {
                    if (fn.name === file.name) {
                        this.productAgreementList.splice(this.productAgreementList.indexOf(fn), 1)
                    }
                }
            },
            handlecirculateLicenseRemove (file, fileList) {
                for (var fn of this.circulateLicenseList) {
                    if (fn.name === file.name) {
                        this.circulateLicenseList.splice(this.circulateLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handledetectPhotocopyRemove (file, fileList) {
                for (var fn of this.detectPhotocopyList) {
                    if (fn.name === file.name) {
                        this.detectPhotocopyList.splice(this.detectPhotocopyList.indexOf(fn), 1)
                    }
                }
            },
            handlegoodsDeclarationRemove (file, fileList) {
                for (var fn of this.goodsDeclarationList) {
                    if (fn.name === file.name) {
                        this.goodsDeclarationList.splice(this.goodsDeclarationList.indexOf(fn), 1)
                    }
                }
            },
            handleproductListRemove (file, fileList) {
                for (var fn of this.productListList) {
                    if (fn.name === file.name) {
                        this.productListList.splice(this.productListList.indexOf(fn), 1)
                    }
                }
            },
            handlecompanyLicenseRemove (file, fileList) {
                for (var fn of this.companyLicenseList) {
                    if (fn.name === file.name) {
                        this.companyLicenseList.splice(this.companyLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleentrustAgreementRemove (file, fileList) {
                for (var fn of this.entrustAgreementList) {
                    if (fn.name === file.name) {
                        this.entrustAgreementList.splice(this.entrustAgreementList.indexOf(fn), 1)
                    }
                }
            },
            handlequalityGuarantyRemove (file, fileList) {
                for (var fn of this.qualityGuarantyList) {
                    if (fn.name === file.name) {
                        this.qualityGuarantyList.splice(this.qualityGuarantyList.indexOf(fn), 1)
                    }
                }
            },
            handlerecordTableRemove (file, fileList) {
                for (var fn of this.recordTableList) {
                    if (fn.name === file.name) {
                        this.recordTableList.splice(this.recordTableList.indexOf(fn), 1)
                    }
                }
            },
            handleepidemicPreventionRemove (file, fileList) {
                for (var fn of this.epidemicPreventionList) {
                    if (fn.name === file.name) {
                        this.epidemicPreventionList.splice(this.epidemicPreventionList.indexOf(fn), 1)
                    }
                }
            },
            handleindustryLicenseRemove (file, fileList) {
                for (var fn of this.industryLicenseList) {
                    if (fn.name === file.name) {
                        this.industryLicenseList.splice(this.industryLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlesalesAuthorizationRemove (file, fileList) {
                for (var fn of this.salesAuthorizationList) {
                    if (fn.name === file.name) {
                        this.salesAuthorizationList.splice(this.salesAuthorizationList.indexOf(fn), 1)
                    }
                }
            },
            handletestProveRemove (file, fileList) {
                for (var fn of this.testProveList) {
                    if (fn.name === file.name) {
                        this.testProveList.splice(this.testProveList.indexOf(fn), 1)
                    }
                }
            },
            handlecccLicenseRemove (file, fileList) {
                for (var fn of this.cccLicenseList) {
                    if (fn.name === file.name) {
                        this.cccLicenseList.splice(this.cccLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlegoodsProveRemove (file, fileList) {
                for (var fn of this.goodsProveList) {
                    if (fn.name === file.name) {
                        this.goodsProveList.splice(this.goodsProveList.indexOf(fn), 1)
                    }
                }
            },
            handlebrandAuthorizationRemove (file, fileList) {
                for (var fn of this.brandAuthorizationList) {
                    if (fn.name === file.name) {
                        this.brandAuthorizationList.splice(this.brandAuthorizationList.indexOf(fn), 1)
                    }
                }
            },
        },
    }
</script>